package o;

import android.app.Activity;
import android.content.Context;
import com.huawei.appgallery.foundation.application.pkgmanage.model.update.ApkUpgradeInfo;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.updatemanager.ui.cardkit.bean.UpdateRecordCardBean;
import com.huawei.fastengine.fastview.startFastappEngine.bean.RpkInfo;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

public class dba {
    private static String ˋ(ApkUpgradeInfo apkUpgradeInfo) {
        long ـ;
        if (apkUpgradeInfo.ॱʽ() == 1 && cep.ˏ() && apkUpgradeInfo.ـ() > 0) {
            ـ = apkUpgradeInfo.ـ();
        } else {
            ـ = apkUpgradeInfo.ʻॱ();
        }
        return epw.ˊ(ـ);
    }

    public static UpdateRecordCardBean ˋ(ApkUpgradeInfo apkUpgradeInfo, boolean z) {
        UpdateRecordCardBean updateRecordCardBean = new UpdateRecordCardBean();
        updateRecordCardBean.ˉ(apkUpgradeInfo.ॱ());
        updateRecordCardBean.ˋ(apkUpgradeInfo.ˊ());
        updateRecordCardBean.ˏˎ(apkUpgradeInfo.ᐝ());
        updateRecordCardBean.ˈ(apkUpgradeInfo.ʻ());
        updateRecordCardBean.ʼॱ(apkUpgradeInfo.ʽ());
        updateRecordCardBean.ˏ(apkUpgradeInfo.ʼ());
        updateRecordCardBean.ʾ(apkUpgradeInfo.ॱॱ());
        updateRecordCardBean.ˎˏ(apkUpgradeInfo.ˊॱ());
        updateRecordCardBean.ͺॱ(apkUpgradeInfo.ॱˊ());
        updateRecordCardBean.ˑ(apkUpgradeInfo.ͺ());
        updateRecordCardBean.ʽ(apkUpgradeInfo.ˏॱ());
        updateRecordCardBean.ॱ(apkUpgradeInfo.ʻॱ());
        updateRecordCardBean.ॱʻ(apkUpgradeInfo.ॱˎ());
        updateRecordCardBean.ˋᐝ(apkUpgradeInfo.ॱᐝ());
        updateRecordCardBean.ᐝ(apkUpgradeInfo.ᐝॱ());
        updateRecordCardBean.ॱᐝ(String.valueOf(apkUpgradeInfo.ʿ()));
        updateRecordCardBean.ˏॱ(apkUpgradeInfo.ˈ());
        updateRecordCardBean.ˋॱ(apkUpgradeInfo.ʾ());
        updateRecordCardBean.ॱʼ(apkUpgradeInfo.ʼॱ());
        updateRecordCardBean.ʼ(apkUpgradeInfo.ˉ());
        updateRecordCardBean.ॱʽ(apkUpgradeInfo.ˋˊ());
        updateRecordCardBean.ॱˊ(apkUpgradeInfo.ˊˊ());
        updateRecordCardBean.ॱ(apkUpgradeInfo.ˊᐝ());
        updateRecordCardBean.ˊॱ(apkUpgradeInfo.ˊˋ());
        updateRecordCardBean.ॱˊ(apkUpgradeInfo.ˌ());
        updateRecordCardBean.ˊ(ˋ(apkUpgradeInfo));
        updateRecordCardBean.ˊॱ(apkUpgradeInfo.ˍ());
        updateRecordCardBean.ˋˊ(apkUpgradeInfo.ˑ());
        updateRecordCardBean.ˌ(apkUpgradeInfo.ͺॱ());
        updateRecordCardBean.ʻ(apkUpgradeInfo.ˏˏ());
        updateRecordCardBean.ˊ(z);
        updateRecordCardBean.ˎ(apkUpgradeInfo.ˏˎ());
        updateRecordCardBean.ˏ(apkUpgradeInfo.ctype_);
        updateRecordCardBean.ʽ(apkUpgradeInfo.fUrl_);
        updateRecordCardBean.ͺ(apkUpgradeInfo.ॱʽ());
        updateRecordCardBean.showDisclaimer_ = apkUpgradeInfo.showDisclaimer_;
        updateRecordCardBean.genShortcutForWebApp_ = apkUpgradeInfo.genShortcutForWebApp_;
        updateRecordCardBean.webApp_ = apkUpgradeInfo.webApp_;
        updateRecordCardBean.jumpToGpOnGMSDevice_ = apkUpgradeInfo.jumpToGpOnGMSDevice_;
        updateRecordCardBean.gplinkPkgName_ = apkUpgradeInfo.gplinkPkgName_;
        return updateRecordCardBean;
    }

    public static List<CardBean> ˏ(List<ApkUpgradeInfo> list, boolean z) {
        if (list == null || list.isEmpty()) {
            return null;
        }
        List<CardBean> arrayList = new ArrayList();
        int size = list.size();
        for (int i = 0; i < size; i++) {
            ApkUpgradeInfo apkUpgradeInfo = (ApkUpgradeInfo) list.get(i);
            if (apkUpgradeInfo != null) {
                arrayList.add(ˋ(apkUpgradeInfo, z));
            }
        }
        return arrayList;
    }

    public static void ॱ(final Context context, final String str, String str2) {
        dmq.ˏ.ॱ(new dmi() {
            public void run() {
                ((czu) dbn.ˎ(czu.class)).ॱ(context, str);
            }
        });
    }

    public static void ˎ(final UpdateRecordCardBean updateRecordCardBean, final Context context) {
        dmq.ˏ.ॱ(new dmi() {
            public void run() {
                czu o_czu = (czu) dbn.ˎ(czu.class);
                String ॱـ = updateRecordCardBean.ॱـ();
                o_czu.ˋ(context, ॱـ, true);
                if (dao.ˏ().ˎ() != null && dao.ˏ().ˎ().ˏ(ॱـ) != null) {
                    LinkedHashMap linkedHashMap = new LinkedHashMap();
                    linkedHashMap.put(RpkInfo.APPID, updateRecordCardBean.ͺˏ());
                    linkedHashMap.put("type", String.valueOf(7));
                    linkedHashMap.put("service_type", String.valueOf(dgm.ˎ((Activity) context)));
                    linkedHashMap.put("detailid", updateRecordCardBean.ॱॱ());
                    dgh.ˋ("card_installbtn_click", linkedHashMap);
                    dao.ˏ().ˎ().ˎ(ॱـ);
                }
            }
        });
    }

    public static void ˏ(final Context context) {
        dmq.ˏ.ॱ(new dmi() {
            public void run() {
                ((czu) dbn.ˎ(czu.class)).ॱ(context);
            }
        });
    }
}
